package cn.com.yto56.cainiao.exponent.front.controller;

import cn.com.yto56.cainiao.exponent.dto.AjaxResponse;
import cn.com.yto56.cainiao.exponent.front.service.FrontHandleService;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("front")
@RestController
public class FrontQueryController {

    @Autowired
    private FrontHandleService frontHandleService;

    @GetMapping("/queryInbound/{mailNo}")
    public String queryInbound(@PathVariable String mailNo) {
        return frontHandleService.queryInbound(mailNo);
    }

    @GetMapping("/queryCanvassTime/{mailNo}")
    public String queryCanvassTime(@PathVariable String mailNo) {
        AjaxResponse ajaxResponse = new AjaxResponse().success(frontHandleService.queryCanvassTime(mailNo));
        return JSON.toJSONString(ajaxResponse);
    }

}
